Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat](ios) Add ios assets-library url support #259

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NathanaelA
Copy link
Contributor

PR Checklist

What is the current behavior?

On iOS all assets-library urls are unable to be uploaded; normally you will get an assets-library url from a Gallery picker.

What is the new behavior?

  1. assets-library:// urls are detected and are able to be uploaded.
  • PHAsset based urls should be able to now be easily added to the code base, as the assets-library urls are converted to the modern PHAsset.
  1. demo-server now handles multipart properly so we can verify everything is correctly built and uploaded.
  2. Multipart uploads now handle multiple large files without running out of memory as all changes are now streamed to disk directly rather than to a large memory pointer (which was then written)...

Fixes/Implements/Closes #[Issue Number].
N/A

BREAKING CHANGES:
uploadFile / multipartUpload now return a PROMISE instead of a task. The Promise will resolve with the task. However, the process to ask iOS for permission to access the gallery item and retrieve the item from the PHAsset system requires callbacks; requiring that these now return a promise that retrieves the task so that the task can still be created properly...

Migration steps:
Change

let task = uploadFile(...)
// All your older code

to

let promiseTask = uploadFile(...);
promiseTask.then( (task) => {
   // All your older code
});

or

let task = await uploadFile(...);
// All your older code

@cla-bot cla-bot bot added the cla: yes label Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant